<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:ace="http://www.icefaces.org/icefaces/components"
    xmlns:ice="http://www.icesoft.com/icefaces/component"
  	xmlns:icecore="http://www.icefaces.org/icefaces/core"
    xmlns:ui="http://java.sun.com/jsf/facelets">
    
     
	<ui:composition template="../WEB-INF/templates/chartTemplate.xhtml">
	
		<ui:param name="title" value="Fact Entry System" />
        	
		<ui:define name="header">
			<ui:include src="../WEB-INF/templates/header.xhtml" /> 
		</ui:define>
		
		<ui:define name="menu">		
			<ui:include src="../WEB-INF/templates/menuLeft.xhtml" />               
		</ui:define>
		
		<ui:define name="content">
		
		    <h:messages globalOnly="true" style="color: red;" />
		    <b>From :<ice:selectOneMenu value="#{factReportBean.fromMonth}">
   						<f:selectItems value="#{selectBoxBean.monthList}" ></f:selectItems>
 				</ice:selectOneMenu>
 				<ice:selectOneMenu value="#{factReportBean.fromYear}">
   						<f:selectItems value="#{selectBoxBean.yearList}" ></f:selectItems>
 				</ice:selectOneMenu>
 			</b> 
 			<b>To :<ice:selectOneMenu value="#{factReportBean.toMonth}">
   						<f:selectItems value="#{selectBoxBean.monthList}" ></f:selectItems>
 				</ice:selectOneMenu>
 				<ice:selectOneMenu value="#{factReportBean.toYear}">
   						<f:selectItems value="#{selectBoxBean.yearList}" ></f:selectItems>
 				</ice:selectOneMenu>
 			</b> 
		    
                 	<h:commandButton id="reportButton" actionListener="#{factReportBean.submit}"  action="#{factReportBean.getFactReport}"  value="Generate Report" style="width:145px;height:32px;" />
            
		    <br/><br/>
	  
           <ace:dataTable id="factReportTable"
                          value="#{factReportBean.list}"
                          var="factReport" binding="#{table}" rendered="#{! empty factReportBean.list}" >
                          
                <ace:column id="id" headerText="ID"  styleClass="columnAlignCenter" >
                   <h:outputText id="serial" value="#{table.rowIndex+1}" ></h:outputText>
                </ace:column>
                <ace:column id="name" headerText="Month, Year" styleClass="columnAlignLeft">
                    <h:outputText id="monthYear" value="#{factReport.monthYear}"></h:outputText>
                  
                </ace:column>
                <ace:column id="totalValue" headerText="Total Value" style="width:400px;" styleClass="columnAlignLeft">
                   <h:outputText id="total" value="#{factReport.total}"></h:outputText>
                </ace:column>
                
                    
            </ace:dataTable>
          
           
             <ice:panelGroup style="margin-top: 20px;clear: both;"  rendered="#{! empty factReportBean.list}">
            
            		   <ace:chart id="chart"
                       animated="true"
                       value="#{factReportBean.barData}"
                       stackSeries="false"
                       xAxis="#{factReportBean.barDemoXAxis}"
                       yAxis="#{factReportBean.barDemoYAxis}"
                       legend="true"
                       legendPlacement="OUTSIDE_GRID"
                       highlighter="true"
                       highlighterLocation="N"
                       highlighterShowMarker="false"
                       highlighterBringSeriesToFront="true"
                       widgetVar="barChart"/>
                       
     
     		</ice:panelGroup>
     	
          
          
       </ui:define>
		
		<ui:define name="footer">
	       <ui:include src="../WEB-INF/templates/footer.xhtml" /> 
		</ui:define>
		
	</ui:composition>
	
</html>